/*
 * This file is part of the quickTools support library, dubbed "LucasCode"
 *
 * Copyright (C) 2005-2008 Lucas Romero
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
using System;
using System.Text.RegularExpressions;

namespace Expressions
{
	/// <summary>
	/// Zusammenfassung fr RegularExpressions.
	/// </summary>
	internal class RegularExpression
	{
		public static RegexOptions ro = RegexOptions.Singleline | RegexOptions.IgnoreCase;
	}
	internal class Ladders : RegularExpression
	{
		// Prefiltering
		public static Regex PreFilter = new System.Text.RegularExpressions.Regex("(Latest|Recent) matches.*?<img src=\".*/comment.gif\".*?</a>",ro);
		// Ligen (Land Gruppe 1, Liga Gruppe 2) & "all matches" Link (Gruppe 3) auslesen 
		public static Regex LadderInfos = new Regex("<img src=\"http://gfx.esl-europe.net/gfx/nodelogo/(\\w{2})_small.gif\".*?>\\n.*?&nbsp;(.*?)</td></tr>.*?\\| <a href=\"(/.*?/all_matches/\\d+/\\d+/)\">Show all matches</a>",ro);
	}
	internal class Teams : RegularExpression
	{
		// Prefiltering
		public static Regex PreFilter = new Regex("My accounts(.*?)Bookmarks",ro);
		// Teams & TeamURLs auslesen
		public static Regex TeamInfos = new Regex("dqm__subdesc\\d+_\\d+ = \"(.*?)\";dqm__url\\d+_\\d+ = \"(.*?)\";",ro);
	}
	internal class Advertisement : RegularExpression
	{
		// parse html content for the advertisement-iframe
		public static Regex ParseAdvertisement = new Regex(@"<iframe.*?src='(.*?)'.*?iframe>",ro);
	}
	internal class Matches : RegularExpression
	{
		public static Regex PreFilter = new Regex("All Matches for .*?<img src=\"http://gfx.esl-europe.net/gfx/nodelogo/\\w{2}_small.gif\".*?((<tr bgcolor=\"#000000\"><td .*?class=\"WindowHeader\">)|(<img src=\"http://gfx.esl-europe.net/gfx/black.gif\"))",ro);
		public static Regex LastMatches = new Regex(">(\\w{3,6}day, \\d\\d/\\d\\d/\\d\\d \\d\\d:\\d\\d)<.*?&nbsp;\\n\\s*(?:<b>){0,1}(.*?)<.*?<a href=\"(.*?)\">.*?<b>(?!<)(.*?)</b>",ro);
		public static Regex FTPPreFilter = new Regex("FTP Upload.*?</form>",ro);
		public static Regex UploadedFiles = new Regex("<input size=\".*?ftpfile\\[(\\d*?)\\].*?value=\"(.*?)\".*?value=\"(.*?)\".*?value=\"(.*?)\"",ro);
	}
}
